﻿<%@ Page Title="Thư viện ảnh sản phẩm" Language="vb" AutoEventWireup="false" MasterPageFile="~/Master/InSite.Master" CodeBehind="Gallery.aspx.vb" Inherits="Core.Gallery" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<fieldset style="width:350px;margin: 0 auto;">
    <table width="100%">
        <tr>
            <td style="width:110px; color: #666666;">
                Tên sản phẩm:
            </td>
            <td>
                <asp:TextBox ID="txtName" class="mediumfield" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width:110px; color: #666666;">
                Mã sản phẩm:
            </td>
            <td>
                <asp:TextBox ID="txtCode" class="mediumfield" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width:110px; color: #666666;">
                Danh mục:
            </td>
            <td>
                <asp:DropDownList ID="cbxMenu" runat="server" CssClass="centerCbx" Visible="true"></asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td style="width:110px; color: #666666;">
                Trạng thái:
            </td>
            <td>
                <asp:DropDownList ID="cbxStatus" runat="server" CssClass="centerCbx" Width="218px"></asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td style="width:110px; color: #666666;vertical-align: middle;">
                Còn hàng:
            </td>
            <td>
                <span><input class="inputChk" type="checkbox" id="chkStock" checked='true' runat="server"  style="margin-left:-25px;margin-top: 3px;"/> 
                <labelChk style="margin-left:0px;margin-top: 3px;"></labelChk></span>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" class="button" Height="26px" />
            </td>
        </tr>
    </table>
</fieldset>
<br />
    <asp:Label ID="lbSort" runat="server" Text="ASC" Visible="false"></asp:Label>
    <asp:Label ID="lbSql" runat="server" Text="" Visible="false"></asp:Label>
<fieldset>
    <legend>Danh sách sản phẩm</legend>
    <asp:SqlDataSource ID="dsSource" runat="server"></asp:SqlDataSource>
    <asp:GridView runat="server" ID="gridMenu" AutoGenerateColumns="false" DataSourceID="dsSource" 
        class="tblMain" DataKeyNames="SubCatID" BorderWidth="0" Width="100%" ShowHeader="false">
        <Columns>
            <asp:TemplateField ItemStyle-BackColor="#9097A9" >
                <ItemStyle Width="100%" />
                <ItemTemplate>
                    <asp:Label Visible="false" runat="server" ID="lbl_ID" Text='<%#Eval("SubCatID") %>'></asp:Label>
                    <asp:Label Visible="true" runat="server" ID="lbl_CatName" Text='<%#showBreadCrumbs(Eval("CatPageName"), Eval("SubCatPageName")) %>'></asp:Label>
                    <asp:Label Visible="false" runat="server" ID="lb_GridID" Text='<%#Container.DataItemIndex + 2 %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ItemStyle-BackColor="#9097A9">
                <ItemTemplate>  
                    </td></tr>  
                    <tr>  
                <td colspan="100%" style="padding: 0px;border:1px solid #9097a9;"><div id="div<%#(Container.DataItemIndex + 2).ToString("00") %>" class="tblChild">  
                    <asp:GridView ID="gridChild" runat="server" class="tblMain" 
                        AutoGenerateColumns="False" GridLines="Horizontal" AllowPaging="True" 
                        PageSize="10" AllowSorting="false" DataKeyNames="ProID" Width="100%"
                        OnPageIndexChanging="gridChild_PageIndexChanging"
                        OnSorting="gridChild_Sorting"
                        OnRowCreated="gridChild_RowCreated"
                        >
                        <EmptyDataTemplate>
                            <asp:Label ID="lblEmptySearch" runat="server" ForeColor="Red">Không có sản phẩm phù hợp</asp:Label>
                        </EmptyDataTemplate>
                        <Columns>
                            <asp:TemplateField HeaderText="No.">
                                <ItemTemplate>
                                    <asp:Label Visible="false" runat="server" ID="lbl_ID" Text='<%#Eval("ProID") %>'></asp:Label>
                                    <asp:Label Visible="false" runat="server" ID="lbl_Name" Text='<%#Eval("ProName") %>'></asp:Label>
                                    <asp:Label Visible="false" runat="server" ID="lbl_Code" Text='<%#Eval("ProCode") %>'></asp:Label>
                                    <asp:Label Visible="false" runat="server" ID="lblSubCatID" Text='<%#Eval("SubCatID") %>'></asp:Label>
                                    <asp:Label Visible="true" runat="server" ID="lblNo" Text='<%#Container.DataItemIndex + 1 %>'></asp:Label>
                                    <asp:Label Visible="false" runat="server" ID="lbStt" Text='<%#Eval("ProStt") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle Width="30px" HorizontalAlign="Left" ForeColor="Black" />
                                <ItemStyle Width="30px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tên SP" SortExpression="ProName">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" Text='<%#Eval("ProName")%>' PostBackUrl='<%#formatLink(Eval("ProID")) %>'></asp:LinkButton>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="ProName" Text='<%#formatUnicode(Eval("ProName")) %>' Width="90%"></asp:TextBox>
                                </EditItemTemplate>
                                <HeaderStyle HorizontalAlign="Left" ForeColor="Black" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Mã SP" SortExpression="ProCode">
                                <ItemStyle Width="80px" />
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" Text='<%#Eval("ProCode")%>' PostBackUrl='<%#formatLink(Eval("ProID")) %>'></asp:LinkButton>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="ProCode" Text='<%#Eval("ProCode") %>' Width="100" ></asp:TextBox>
                                </EditItemTemplate>
                                <HeaderStyle HorizontalAlign="Left" ForeColor="Black" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Giá SP" SortExpression="ProNewPrice">
                                <ItemStyle Width="80px" />
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_Price" Text='<%#formatCurrency(Eval("ProNewPrice")) %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="txtPrice" Text='<%#Eval("ProNewPrice") %>' Width="50"></asp:TextBox>
                                </EditItemTemplate>
                                <HeaderStyle HorizontalAlign="center" ForeColor="Black" />
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Trạng thái">
                                <ItemTemplate>
                                    <asp:Label ID="lblStt" runat="server" Text='<%#getColorStt(Eval("ProStt")) %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:DropDownList ID="ddlStt" runat="server"></asp:DropDownList>
                                </EditItemTemplate>
                                <HeaderStyle Width="60px" HorizontalAlign="Left"  ForeColor="Black"/>
                                <ItemStyle Width="60px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Sửa" ShowHeader="False" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="100"> 
                                <EditItemTemplate> 
                                    <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="True" CommandName="Update" ImageUrl="~/static/inSite/images/save.png" CssClass="noneCSS"/>
                                    <asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="~/static/inSite/images/stop.png" CssClass="noneCSS"/>
                                </EditItemTemplate> 
                                <ItemTemplate> 
                                    <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" CommandName="Edit" ImageUrl="~/static/inSite/images/edit.png" CssClass="noneCSS"/>
                                </ItemTemplate> 
                                <HeaderStyle HorizontalAlign="Center" ForeColor="Black"></HeaderStyle>
                                <ItemStyle Width="65px" HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField> 
                            <asp:TemplateField HeaderText="Xóa" ShowHeader="False" HeaderStyle-HorizontalAlign="Right" ItemStyle-Width="20"> 
                                <ItemTemplate> 
                                    <asp:ImageButton ID="butDelete" runat="server" CausesValidation="False" CommandName="Delete" ImageUrl="~/static/inSite/images/recycle.png" CssClass="noneCSS" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa <Sản Phẩm> này? \n\nChú ý: Bạn có thể phục hồi lại Sản phẩm từ mục <Lưu trữ>.');"/>
                                </ItemTemplate> 
                                <HeaderStyle HorizontalAlign="Center" ForeColor="Black"></HeaderStyle>
                                <ItemStyle Width="20px" HorizontalAlign="Right"></ItemStyle>
                            </asp:TemplateField> 
                            <asp:TemplateField HeaderText="Kho">
                                <ItemTemplate>
                                    <asp:Label ID="lbPms" runat="server" Text='<%#getColorStock(Eval("ProIsStock")) %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle Width="30px" HorizontalAlign="center"  ForeColor="Black"/>
                                <ItemStyle Width="30px" />
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle HorizontalAlign="Center" CssClass="subPageFunction" />
                    </asp:GridView>
                </div></td></tr> 
                <tr><td style="background-color:#e8e8e8;"></td></tr> 
                </ItemTemplate>  
            </asp:TemplateField>  
        </Columns>
    </asp:GridView>
</fieldset>
</asp:Content>
